<!--
  User: Kuttubek Aidaraliev
  Date: 06.04.2010
  Time: 15:51:24
-->
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:a4j="http://richfaces.org/a4j"
    template="../../WEB-INF/jspx/common/template.xhtml">

    <ui:define name="head">
        <title>
            <h:outputText value="#{messages.customerList}" />
        </title>
    </ui:define>


    <ui:define name="body">
     <h3 align="center"><h:outputText value="#{messages.customerList}" /></h3>
     <h:form>
         <h:commandButton value="#{messages.create}" action="#{customerBeanController.preInsert}">
             <f:setPropertyActionListener value="true" target="#{customerBean.requisiteEditing}"/>
         </h:commandButton>
     </h:form>
         <rich:spacer height="10" width="100%" />
         <!--<rich:datascroller for="customerListBeanId" align="left" rendered="#{not empty customerBeanController.customerDataModel}"/>-->
         <rich:dataTable value="#{customerBeanController.realList}"
                         var="customer"
                         width="100%"
                         binding="#{customerBeanController.dataTable}"
                         id="customerListBeanId">

             <rich:column>
                <f:facet name="header">
                    <h:outputText value="#{messages.id}" />
                </f:facet>
                <h:outputText value="#{customer.id}" />
             </rich:column>

             <rich:column>
                <f:facet name="header">
                    <h:outputText value="#{messages.number}"/>
                </f:facet>
                <h:outputText value="#{customer.number}" />
             </rich:column>

              <rich:column>
                <f:facet name="header">
                    <h:outputText value="#{messages.codeName}"/>
                </f:facet>
                <h:outputText value="#{customer.codeName}" />
             </rich:column>

             <rich:column>
                <f:facet name="header">
                    <h:outputText value="#{messages.officialName}"/>
                </f:facet>
                <h:outputText value="#{customer.officialName}" />
             </rich:column>

             <rich:column>
                <f:facet name="header">
                    <h:outputText value="#{messages.region}"/>
                </f:facet>
                <h:outputText value="#{customer.region.title}">
                </h:outputText>
             </rich:column>

             <rich:column>
                <f:facet name="header">
                    <h:outputText value="#{messages.website}"/>
                </f:facet>
                <h:outputText value="#{customer.website}" />
             </rich:column>

             <!--<rich:column>
                <f:facet name="header">
                    <h:outputText value="#{messages.country}"/>
                </f:facet>
                <h:outputText value="#{customer.country}" />
             </rich:column>

             <rich:column>
                <f:facet name="header">
                    <h:outputText value="#{msgs.region}"/>
                </f:facet>
                <h:outputText value="#{customer.region}" />
             </rich:column>

             <rich:column>
                <f:facet name="header">
                    <h:outputText value="#{msgs.city}"/>
                </f:facet>
                <h:outputText value="#{customer.city}" />
             </rich:column>

             <rich:column>
                <f:facet name="header">
                    <h:outputText value="#{msgs.postCode}"/>
                </f:facet>
                <h:outputText value="#{customer.postCode}" />
             </rich:column>

              <rich:column>
                <f:facet name="header">
                    <h:outputText value="#{messages.dateBirth}"/>
                </f:facet>
                <h:outputText value="#{customer.dateBirth}">
                    <f:convertDateTime dateStyle="short"/>
                </h:outputText>
             </rich:column>-->

              <rich:column>
                <f:facet name="header">
                    <h:outputText value="#{messages.operation}"/>
                </f:facet>
                  <h:form>
                    <h:commandLink action="#{customerBeanController.view}">
                        <h:outputText value="#{messages.view}" />
                        <f:setPropertyActionListener value="#{customer}" target="#{customerBean.entity}"/>
                    </h:commandLink>
                  </h:form>
                  <rich:spacer height="10" width="20" />
                  <a4j:region>
                      <a4j:form>
                           <a4j:htmlCommandLink id="delete" action="#{customerBeanController.deleted}">
                                <h:outputText value="#{messages.delete}" />
                                <f:setPropertyActionListener value="#{customer}" target="#{customerBean.entity}"/>
                           </a4j:htmlCommandLink>
                      </a4j:form>
                  </a4j:region>
             </rich:column>

            <!-- <rich:column>
                <f:facet name="header">
                    <h:outputText value="#{messages.delete}"/>
                </f:facet>
                 <h:commandLink action="#{customerBeanController.deleted}">
                    <h:outputText value="#{messages.delete}" />
                    <f:setPropertyActionListener value="#{customer}" target="#{customerBeanController.customer}"/>
                 </h:commandLink>
             </rich:column>  -->

         </rich:dataTable>
  </ui:define>
</ui:composition>